﻿using System;
using System.Collections.Generic;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class GetListsSubscriptionsCommand : TwitterCommand
    {
        private const Int32 MaxCount = 1000;
        private Int32 _Count = 20;
        /// <summary>
        /// 
        /// </summary>
        public Int64? UserID { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public String ScreenName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public Int64? Cursor { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public Int32 Count
        {
            get { return _Count; }
            set
            {
                if (value < 0)
                {
                    throw new ArgumentException();
                }
                if (value > MaxCount)
                {
                    value = MaxCount;
                }
                _Count = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected override IDictionary<String, String> CreateParameters()
        {
            Dictionary<String, String> d = new Dictionary<String, String>();
            d["user_id"] = this.UserID.ToString();
            d["screen_name"] = this.ScreenName;
            d["cursor"] = this.Cursor.ToString();
            d["count"] = this.Count.ToString();
            return d;
        }
    }
}
